.class Lcom/example/m6wmr/AniActivity$2;
.super Ljava/lang/Thread;
.source "AniActivity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/example/m6wmr/AniActivity;->savearea()Z
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/example/m6wmr/AniActivity;


# direct methods
.method constructor <init>(Lcom/example/m6wmr/AniActivity;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    .line 124
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 15

    .prologue
    const-wide/16 v13, 0x5dc

    .line 126
    invoke-super {p0}, Ljava/lang/Thread;->run()V

    .line 129
    new-instance v5, Landroid/os/Message;

    invoke-direct {v5}, Landroid/os/Message;-><init>()V

    .line 131
    .local v5, "msg":Landroid/os/Message;
    new-instance v8, Ljava/lang/StringBuilder;

    iget-object v9, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    iget-object v9, v9, Lcom/example/m6wmr/AniActivity;->m:Lmyapp/MyApp;

    invoke-virtual {v9}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v9

    invoke-static {v9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 132
    const-string v9, "/index.php?ctrl=app&action=appallarea&datatype=json"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    .line 131
    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    .line 133
    .local v7, "url":Ljava/lang/String;
    const-string v8, "Aniactivity"

    new-instance v9, Ljava/lang/StringBuilder;

    const-string v10, "savearea() \u4fdd\u5b58\u533a\u57df"

    invoke-direct {v9, v10}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v9, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Lmyapp/Mylog;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 134
    iget-object v8, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    iget-object v8, v8, Lcom/example/m6wmr/AniActivity;->m:Lmyapp/MyApp;

    invoke-static {v7, v8}, LPlugclass/HttpConn;->getStr(Ljava/lang/String;Lmyapp/MyApp;)Ljava/lang/String;

    move-result-object v6

    .line 136
    .local v6, "str":Ljava/lang/String;
    :try_start_0
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v6}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 137
    .local v4, "json":Lorg/json/JSONObject;
    const-string v8, "error"

    invoke-virtual {v4, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "true"

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_0

    .line 138
    const/4 v8, 0x1

    iput v8, v5, Landroid/os/Message;->arg1:I
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 176
    :goto_0
    iget-object v8, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    iget-object v8, v8, Lcom/example/m6wmr/AniActivity;->h:Landroid/os/Handler;

    invoke-virtual {v8, v5, v13, v14}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    .line 178
    .end local v4    # "json":Lorg/json/JSONObject;
    :goto_1
    return-void

    .line 140
    .restart local v4    # "json":Lorg/json/JSONObject;
    :cond_0
    :try_start_1
    const-string v8, "msg"

    invoke-virtual {v4, v8}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 141
    const/4 v8, 0x1

    iput v8, v5, Landroid/os/Message;->arg1:I
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 170
    .end local v4    # "json":Lorg/json/JSONObject;
    :catch_0
    move-exception v1

    .line 172
    .local v1, "e":Lorg/json/JSONException;
    :try_start_2
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 173
    const/4 v8, 0x1

    iput v8, v5, Landroid/os/Message;->arg1:I
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 176
    iget-object v8, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    iget-object v8, v8, Lcom/example/m6wmr/AniActivity;->h:Landroid/os/Handler;

    invoke-virtual {v8, v5, v13, v14}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    goto :goto_1

    .line 143
    .end local v1    # "e":Lorg/json/JSONException;
    .restart local v4    # "json":Lorg/json/JSONObject;
    :cond_1
    :try_start_3
    const-string v8, "msg"

    invoke-virtual {v4, v8}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 145
    .local v3, "jarray":Lorg/json/JSONArray;
    iget-object v8, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    # getter for: Lcom/example/m6wmr/AniActivity;->db:Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {v8}, Lcom/example/m6wmr/AniActivity;->access$0(Lcom/example/m6wmr/AniActivity;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v8

    const-string v9, "area"

    const-string v10, "id !=\'\' "

    const/4 v11, 0x0

    invoke-virtual {v8, v9, v10, v11}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    .line 146
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_2
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v8

    if-lt v2, v8, :cond_2

    .line 166
    const/4 v8, 0x2

    iput v8, v5, Landroid/os/Message;->arg1:I
    :try_end_3
    .catch Lorg/json/JSONException; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    goto :goto_0

    .line 174
    .end local v2    # "i":I
    .end local v3    # "jarray":Lorg/json/JSONArray;
    .end local v4    # "json":Lorg/json/JSONObject;
    :catchall_0
    move-exception v8

    .line 176
    iget-object v9, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    iget-object v9, v9, Lcom/example/m6wmr/AniActivity;->h:Landroid/os/Handler;

    invoke-virtual {v9, v5, v13, v14}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    .line 177
    throw v8

    .line 147
    .restart local v2    # "i":I
    .restart local v3    # "jarray":Lorg/json/JSONArray;
    .restart local v4    # "json":Lorg/json/JSONObject;
    :cond_2
    :try_start_4
    new-instance v0, Lbean/AreaBean;

    invoke-direct {v0}, Lbean/AreaBean;-><init>()V

    .line 148
    .local v0, "bb":Lbean/AreaBean;
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 149
    const-string v9, "id"

    invoke-virtual {v8, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 148
    invoke-virtual {v0, v8}, Lbean/AreaBean;->setId(Ljava/lang/String;)V

    .line 150
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 151
    const-string v9, "name"

    .line 150
    invoke-virtual {v8, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v0, v8}, Lbean/AreaBean;->setname(Ljava/lang/String;)V

    .line 152
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 153
    const-string v9, "parent_id"

    invoke-virtual {v8, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    .line 152
    invoke-virtual {v0, v8}, Lbean/AreaBean;->setparent_id(Ljava/lang/String;)V

    .line 154
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 155
    const-string v9, "lat"

    .line 154
    invoke-virtual {v8, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v0, v8}, Lbean/AreaBean;->setlat(Ljava/lang/String;)V

    .line 156
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v8

    .line 157
    const-string v9, "lng"

    .line 156
    invoke-virtual {v8, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v0, v8}, Lbean/AreaBean;->setlng(Ljava/lang/String;)V

    .line 158
    iget-object v8, p0, Lcom/example/m6wmr/AniActivity$2;->this$0:Lcom/example/m6wmr/AniActivity;

    # getter for: Lcom/example/m6wmr/AniActivity;->db:Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {v8}, Lcom/example/m6wmr/AniActivity;->access$0(Lcom/example/m6wmr/AniActivity;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v8

    .line 159
    const-string v9, "insert into area (id,parent_id,name,lat,lng) values(?,?,?,?,?)"

    .line 160
    const/4 v10, 0x5

    new-array v10, v10, [Ljava/lang/Object;

    const/4 v11, 0x0

    invoke-virtual {v0}, Lbean/AreaBean;->getId()Ljava/lang/String;

    move-result-object v12

    aput-object v12, v10, v11

    const/4 v11, 0x1

    .line 161
    invoke-virtual {v0}, Lbean/AreaBean;->getparent_id()Ljava/lang/String;

    move-result-object v12

    aput-object v12, v10, v11

    const/4 v11, 0x2

    .line 162
    invoke-virtual {v0}, Lbean/AreaBean;->getname()Ljava/lang/String;

    move-result-object v12

    aput-object v12, v10, v11

    const/4 v11, 0x3

    invoke-virtual {v0}, Lbean/AreaBean;->getlat()Ljava/lang/String;

    move-result-object v12

    aput-object v12, v10, v11

    const/4 v11, 0x4

    .line 163
    invoke-virtual {v0}, Lbean/AreaBean;->getlng()Ljava/lang/String;

    move-result-object v12

    aput-object v12, v10, v11

    .line 158
    invoke-virtual {v8, v9, v10}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;[Ljava/lang/Object;)V
    :try_end_4
    .catch Lorg/json/JSONException; {:try_start_4 .. :try_end_4} :catch_0
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    .line 146
    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_2
.end method

.method public declared-synchronized start()V
    .locals 1

    .prologue
    .line 181
    monitor-enter p0

    :try_start_0
    invoke-super {p0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 182
    monitor-exit p0

    return-void

    .line 181
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
